<template>
  <div>
    <li v-for="(val,index) in Arr" :key="index">{{ val }}<button @click="delFn(index)">删除</button></li>
    <button @click="addFn">生成</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      Arr: [1, 2, 3],
    }
  },
  methods:{
addFn(){
  this.Arr.push(Math.floor(Math.random()*100))
},
delFn(index){
  this.Arr.splice(index,1)
}
  }
}
</script>

<style></style>
